package com.arlin.spring.enums;

import io.netty.handler.codec.http.HttpMethod;

public enum RequestHttpMethod {

    GET(RequestMethod.GET, HttpMethod.GET),
    POST(RequestMethod.POST, HttpMethod.POST)
    ;

    private final RequestMethod requestMethod;

    private final HttpMethod httpMethod;

    RequestHttpMethod(RequestMethod requestMethod, HttpMethod httpMethod) {
        this.requestMethod = requestMethod;
        this.httpMethod = httpMethod;
    }

    public static HttpMethod getHttpMethod(RequestMethod requestMethod) {
        for (RequestHttpMethod value : RequestHttpMethod.values()) {
            if (value.requestMethod.equals(requestMethod)) {
                return value.httpMethod;
            }
        }
        return null;
    }
}